#include <iostream>
#include <algorithm>

using namespace std;
#define int long long
const int N = 110;
int a[N];
void solve()
{
    int n , x;
    cin >> n >> x;
    int sum = 0;
    for(int i = 1;i <= n;i ++)
    {
        int y; cin >> y;
        sum += y;
    }
    if(sum == n * x) cout << "YES" << endl;
    else cout << "NO" << endl;
}
signed main()
{
    int t; cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}